/* Author : Dreamguys Template Name: Truelysell - Bootstrap Template */ (function ($) { "use strict"; var $slimScrolls = $('.slimscroll'); var $wrapper = $('.main-wrapper'); // Sidebar Slimscroll if ($slimScrolls.length > 0) { $slimScrolls.slimScroll({ height: 'auto', width: '100%', position: 'right', size: '7px', color: '#ccc', allowPageScroll: false, wheelStep: 10, touchScrollStep: 100 }); var wHeight = $(window).height() - 48; $slimScrolls.height(wHeight); $('.sidebar .slimScrollDiv').height(wHeight); $(window).resize(function () { var rHeight = $(window).height() - 48; $slimScrolls.height(rHeight); $('.sidebar .slimScrollDiv').height(rHeight); }); } // Mobile menu sidebar overlay $('body').append(''); $(document).on('click', '#mobile_btns', function () { $wrapper.toggleClass('slide-nav'); $('.sidebar-overlay').toggleClass('opened'); $('html').toggleClass('menu-opened'); return false; }); $(document).on('click', '#mobile_btn', function () { $wrapper.toggleClass('slide-nav'); $('.sidebar-overlay').toggleClass('opened'); $('html').addClass('menu-opened'); $('#task_window').removeClass('opened'); return false; }); $(".sidebar-overlay").on("click", function () { $('html').removeClass('menu-opened'); $(this).removeClass('opened'); $wrapper.removeClass('slide-nav'); $('.sidebar-overlay').removeClass('opened'); $('#task_window').removeClass('opened'); }); // Sidebar if ($(window).width() <= 991) { var Sidemenu = function () { this.$menuItem = $('.main-nav a'); }; function init() { var $this = Sidemenu; $('.main-nav a').on('click', function (e) { if ($(this).parent().hasClass('has-submenu')) { e.preventDefault(); } if (!$(this).hasClass('submenu')) { $('ul', $(this).parents('ul:first')).slideUp(350); $('a', $(this).parents('ul:first')).removeClass('submenu'); $(this).next('ul').slideDown(350); $(this).addClass('submenu'); } else if ($(this).hasClass('submenu')) { $(this).removeClass('submenu'); $(this).next('ul').slideUp(350); } }); } // Sidebar Initiate init(); } // Sticky Header $(window).scroll(function () { var sticky = $('.header'), scroll = $(window).scrollTop(); if (scroll >= 50) sticky.addClass('fixed'); else sticky.removeClass('fixed'); }); $(document).on('click', '.sidebar-overlay', function () { $('html').removeClass('menu-opened'); $(this).removeClass('opened'); $('main-wrapper').removeClass('slide-nav'); $('#task_window').removeClass('opened'); }); $(document).on('click', '#menu_close', function () { $('html').removeClass('menu-opened'); $('.sidebar-overlay').removeClass('opened'); $('main-wrapper').removeClass('slide-nav'); }); // Small Sidebar //toggle_btn $(document).on('click', '#toggle_btn', function () { if ($('body').hasClass('mini-sidebar')) { $('body').removeClass('mini-sidebar'); $(this).addClass('active'); $('.subdrop + ul'); localStorage.setItem('screenModeNightTokenState', 'night'); setTimeout(function () { $("body").removeClass("mini-sidebar"); $(".header-left").addClass("active"); }, 100); } else { $('body').addClass('mini-sidebar'); $(this).removeClass('active'); $('.subdrop + ul'); localStorage.removeItem('screenModeNightTokenState', 'night'); setTimeout(function () { $("body").addClass("mini-sidebar"); $(".header-left").removeClass("active"); }, 100); } return false; }); function initi() { var $this = Sidemenu; $('#sidebar-menu a').on('click', function (e) { if ($(this).parent().hasClass('submenu')) { e.preventDefault(); } if (!$(this).hasClass('subdrop')) { $('ul', $(this).parents('ul:first')).slideUp(350); $('a', $(this).parents('ul:first')).removeClass('subdrop'); $(this).next('ul').slideDown(350); $(this).addClass('subdrop'); } else if ($(this).hasClass('subdrop')) { $(this).removeClass('subdrop'); $(this).next('ul').slideUp(350); } }); $('#sidebar-menu ul li.submenu a.active').parents('li:last').children('a:first').addClass('active').trigger('click'); } initi(); // Sidebar Initiate $(document).on('mouseover', function (e) { e.stopPropagation(); if ($('body').hasClass('mini-sidebar') && $('#toggle_btn').is(':visible')) { var targ = $(e.target).closest('.sidebar, .header-left').length; if (targ) { $('body').addClass('expand-menu'); $('.subdrop + ul').slideDown(); } else { $('body').removeClass('expand-menu'); $('.subdrop + ul').slideUp(); } return false; } }); // Chat sidebar overlay if ($(window).width() <= 1199) { if ($('#task_chat').length > 0) { $(document).on('click', '#task_chat', function () { $('.sidebar-overlay').toggleClass('opened'); $('#task_window').addClass('opened'); return false; }); } } $(".chat-profile-open").on("click", function () { $('.chat-window-long').toggleClass('window-full-width'); }); $(document).on('click', '#filter_search', function () { $('#filter_inputs').slideToggle("slow"); }); // horizontal-slide document.addEventListener("DOMContentLoaded", function () { const scrollers = document.querySelectorAll(".horizontal-slide"); scrollers.forEach((scroller) => { scroller.setAttribute("data-animated", true); const scrollerInner = scroller.querySelector(".slide-list"); const scrollerContent = Array.from(scrollerInner.children); scrollerContent.forEach((item) => { const duplicatedItem = item.cloneNode(true); duplicatedItem.setAttribute("aria-hidden", true); scrollerInner.appendChild(duplicatedItem); }); }); }); // Testimonial if($('.testimonial-slider-two').length > 0) { $(".testimonial-slider-two").slick({ slidesToShow: 1, slidesToScroll: 1, autoplay: false, autoplaySpeed: 0, speed: 3000, autoplaySpeed: 1800, arrows: true, prevArrow: $('.testimonial-prev'), nextArrow: $('.testimonial-next'), }); } const initWizard = () => { const wizardContainer = document.querySelector(".wizard-container"); // If this element isn't on the page, the function ends here safely if (!wizardContainer) return; const steps = wizardContainer.querySelectorAll(".wizard-step"); const progressBar = wizardContainer.querySelector("#progress-bar"); const nextBtns = wizardContainer.querySelectorAll(".nextBtn"); const prevBtns = wizardContainer.querySelectorAll(".prevBtn"); const cards = wizardContainer.querySelectorAll(".checkbox-item"); if (steps.length === 0) return; let currentStep = 0; // 1. Handle Selection Logic cards.forEach(card => { card.addEventListener("click", function(e) { const radio = this.querySelector('input[type="radio"]'); if (radio && e.target !== radio) { radio.checked = true; } const stepParent = this.closest('.wizard-step'); const siblings = stepParent.querySelectorAll(".checkbox-item"); siblings.forEach(s => s.classList.remove("active")); this.classList.add("active"); // --- NEW: Toggle Textarea Logic --- const othersWrapper = document.getElementById("others-details"); if (othersWrapper) { // Show if the clicked card has the data-type="others" attribute if (this.getAttribute("data-type") === "others") { othersWrapper.style.display = "block"; } else { othersWrapper.style.display = "none"; } } }); }); // 2. Navigation Logic const updateWizard = () => { steps.forEach((step, index) => { step.classList.toggle("active", index === currentStep); // Since steps are stacked in your HTML, we hide/show them step.style.display = (index === currentStep) ? "block" : "none"; }); if (progressBar) { const progress = ((currentStep + 1) / steps.length) * 100; progressBar.style.width = progress + "%"; } }; // Next Buttons nextBtns.forEach(btn => { btn.addEventListener("click", (e) => { e.preventDefault(); if (currentStep < steps.length - 1) { currentStep++; updateWizard(); } }); }); // Prev Buttons prevBtns.forEach(btn => { btn.addEventListener("click", (e) => { e.preventDefault(); if (currentStep > 0) { currentStep--; updateWizard(); } }); }); // Run once on load updateWizard(); }; // Run when the DOM is ready if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", initWizard); } else { initWizard(); } })(jQuery); $(document).ready(function () { // Sidebar Toggle Js $(".offcanvas-close,.offcanvas-overlay").on("click", function () { $(".offcanvas-info").removeClass("show"); $(".offcanvas-overlay").removeClass("overlay-open"); }); $(".sidebar-menu").on("click", function () { $(".offcanvas-info").addClass("show"); $(".offcanvas-overlay").addClass("overlay-open"); }); if ($('#data-table').length > 0) { $('#data-table').DataTable({ "language": { search: ' ', searchPlaceholder: "Search...", info: "_START_ - _END_ of _TOTAL_", paginate: { next: 'Next ', previous: ' Previous' } }, "bFilter": false, initComplete: (settings, json) => { $('.dataTables_length').appendTo('#tablelength'); $('.dataTables_paginate').appendTo('#tablepagination'); $('.dataTables_info').appendTo('#tableinfo'); }, }); } // Body Overlay Js $(".body-overlay").on("click", function () { $(".offcanvas__area").removeClass("offcanvas-opened"); $(".df-search-area").removeClass("opened");; $(".body-overlay").removeClass("opened"); }); // Sticky Header $(window).scroll(function () { if ($(this).scrollTop() > 200) { $("header").addClass("fixed"); } else { $("header").removeClass("fixed"); } }); if ($('.wow').length > 0) { new WOW().init(); } // Fav Icon if ($('.fav-icon').length > 0) { $(".fav-icon").on("click", function () { $(this).toggleClass('selected'); }); } // Booking Select if ($('.select-item').length > 0) { $(".select-item").on("click", function () { $('.select-item').removeClass('selected'); $(this).toggleClass('selected'); }); } if ($('.location-card').length > 0) { $(".location-card").on("click", function () { $('.location-card').removeClass('selected'); $(this).toggleClass('selected'); }); } if ($('.staff-card').length > 0) { $(".staff-card").on("click", function () { $('.staff-card').removeClass('selected'); $(this).toggleClass('selected'); }); } if ($('.time-item').length > 0) { $(".time-item").on("click", function () { $('.time-item').removeClass('selected'); $(this).toggleClass('selected'); }); } // Add if ($('.btn-addon').length > 0) { $('.btn-addon').on('click', function (e) { $(this).addClass("active"); $(this).text("Added"); $(this).prepend(""); }); } //Owl Carousel if ($('.providers-slider').length > 0) { $('.providers-slider').owlCarousel({ loop: true, margin: 10, nav: true, navText: [ '', '' ], responsive: { 0: { items: 1 }, 600: { items: 3 }, 1000: { items: 4 } } }) } // Service slider if ($('.owl-carousel.feature-service-five-slider').length > 0) { $('.owl-carousel.feature-service-five-slider').owlCarousel({ loop: true, margin: 24, nav: true, dots: false, smartSpeed: 2000, navText: ["", ""], responsive: { 0: { items: 1 }, 550: { items: 1 }, 700: { items: 2 }, 1200: { items: 3 }, 1400: { items: 3 } } }) } // Service Slider if ($('.service-slider').length > 0) { $('.service-slider').owlCarousel({ loop: false, margin: 24, nav: true, dots: false, smartSpeed: 2000, autoplay: false, navText: [ '', '' ], // FIX: Add aria-labels once the carousel is ready onInitialized: setNavLabels, onRefreshed: setNavLabels, responsive: { 0: { items: 1 }, 550: { items: 1 }, 768: { items: 2 }, 992: { items: 3 }, 1200: { items: 3 } } }) } // Function to add accessible names to the buttons function setNavLabels(event) { const $carousel = $(event.target); $carousel.find('.owl-prev').attr('aria-label', 'Previous'); $carousel.find('.owl-next').attr('aria-label', 'Next'); // 2. Look inside your custom navContainer (Fix) const customNav = $('.mynav1'); // Match your navContainer selector if (customNav.length > 0) { customNav.find('.owl-prev').attr('aria-label', 'Previous Slide'); customNav.find('.owl-next').attr('aria-label', 'Next Slide'); } } if ($('.say-about.slider-for').length > 0) { $('.say-about.slider-for').slick({ slidesToShow: 1, slidesToScroll: 1, arrows: false, fade: true, asNavFor: '.client-img.slider-nav' }); } if ($('.client-img.slider-nav').length > 0) { $('.client-img.slider-nav').slick({ slidesToShow: 3, slidesToScroll: 1, asNavFor: '.say-about.slider-for', dots: false, arrows: false, centerMode: true, focusOnSelect: true }); } // latest-slider if ($('.owl-carousel.latest-slider').length > 0) { $('.owl-carousel.latest-slider').owlCarousel({ loop: true, margin: 24, nav: true, dots: false, smartSpeed: 2000, // FIX: Add aria-labels once the carousel is ready onInitialized: setNavLabels, onRefreshed: setNavLabels, navText: ["", ""], responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 3 }, 1200: { items: 4 }, 1400: { items: 4 } } }) } // services-slider if ($('.owl-carousel.stylists-slider').length > 0) { $('.owl-carousel.stylists-slider').owlCarousel({ loop: true, margin: 24, nav: true, dots: false, smartSpeed: 2000, navText: ["", ""], responsive: { 0: { items: 1 }, 550: { items: 1 }, 700: { items: 2 }, 1200: { items: 4 }, 1400: { items: 4 } } }) } // Service slider if ($('.owl-carousel.partners-slider').length > 0) { $('.owl-carousel.partners-slider').owlCarousel({ loop: true, margin: 24, nav: false, dots: false, smartSpeed: 2000, responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 3 }, 1200: { items: 5 }, 1400: { items: 5 } } }) } //Home slider if ($('.banner-slider').length > 0) { $('.banner-slider').slick({ dots: false, autoplay: false, infinite: true, slidesToShow: 1, slidesToScroll: 1, arrows: true, responsive: [{ breakpoint: 992, settings: { slidesToShow: 1 } }, { breakpoint: 800, settings: { slidesToShow: 1 } }, { breakpoint: 776, settings: { slidesToShow: 1 } }, { breakpoint: 567, settings: { slidesToShow: 1 } }] }); } $(".top-close").on('click', function () { $(this).closest('.top-bar').slideUp(500); return false; }); // Popular Service slider if ($('.owl-carousel.popular-slider').length > 0) { $('.owl-carousel.popular-slider').owlCarousel({ loop: true, margin: 24, nav: true, dots: false, smartSpeed: 2000, navText: ["", ""], navContainer: '.mynav1', onInitialized: setNavLabels, // Aria label onRefreshed: setNavLabels, // Aria label responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 2 }, 1000: { items: 3 } } }) } // Popular Service slider if ($('.popular-slider-3').length > 0) { $('.popular-slider-3').owlCarousel({ loop: false, margin: 24, nav: true, dots: false, smartSpeed: 2000, onInitialized: setNavLabels, // Aria label onRefreshed: setNavLabels, // Aria label navText: ["", ""], responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 2 }, 1000: { items: 3 } } }) } // Service slider if ($('.owl-carousel.car-testimonials-five-slider').length > 0) { $('.owl-carousel.car-testimonials-five-slider').owlCarousel({ loop: true, margin: 24, nav: true, dots: false, smartSpeed: 2000, navText: ["", ""], responsive: { 0: { items: 1 }, 550: { items: 1 }, 700: { items: 1 }, 1000: { items: 1 } } }) } // Service slider if ($('.owl-carousel.partners-five-slider').length > 0) { $('.owl-carousel.partners-five-slider').owlCarousel({ loop: true, margin: 24, nav: false, dots: false, autoplay: true, smartSpeed: 2000, responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 3 }, 1200: { items: 5 }, 1400: { items: 5 } } }) } // Service slider if ($('.owl-carousel.car-blog-slider').length > 0) { $('.owl-carousel.car-blog-slider').owlCarousel({ loop: true, margin: 24, nav: true, dots: false, smartSpeed: 2000, onInitialized: setNavLabels, // Aria label onRefreshed: setNavLabels, // Aria label navText: ["", ""], responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 2 }, 1000: { items: 3 } } }) } // Popular Service slider -02 if ($('.owl-carousel.popular-slider-2').length > 0) { $('.owl-carousel.popular-slider-2').owlCarousel({ loop: true, margin: 24, nav: false, dots: true, smartSpeed: 2000, navText: ["", ""], navContainer: '.mynav1', responsive: { 0: { items: 1, }, 550: { items: 2, }, 700: { items: 2, }, 1000: { items: 3, } } }) } // Service slider if ($('.owl-carousel.top-providers-five').length > 0) { $('.owl-carousel.top-providers-five').owlCarousel({ loop: true, margin: 24, nav: true, dots: false, smartSpeed: 2000, navText: ["", ""], responsive: { 0: { items: 1 }, 550: { items: 1 }, 700: { items: 3 }, 1200: { items: 4 }, 1400: { items: 4 } } }) } //Feature Carousel if ($('.feature-slider').length > 0) { $('.feature-slider').owlCarousel({ loop: false, margin: 24, nav: true, dots: false, smartSpeed: 2000, autoplay: false, navText: [ '', '' ], onInitialized: setNavLabels, // Aria label onRefreshed: setNavLabels, // Aria label responsive: { 0: { items: 1 }, 550: { items: 1 }, 768: { items: 2 }, 1000: { items: 4 } } }) } //Card Image Carousel if ($('.img-slider').length > 0) { $('.img-slider').owlCarousel({ loop: true, margin: 24, nav: true, dots: true, smartSpeed: 2000, autoplay: false, onInitialized: setCarouselAccessibility , // Aria label onRefreshed: setCarouselAccessibility , // Aria label navText: [ '', '' ], responsive: { 0: { items: 1 }, 550: { items: 1 }, 768: { items: 1 }, 1000: { items: 1 } } }) } function setCarouselAccessibility (event) { const $carousel = $(event.target); // Label Navigation Buttons (Arrows) $carousel.find('.owl-prev').attr('aria-label', 'Previous Slide'); $carousel.find('.owl-next').attr('aria-label', 'Next Slide'); // Label Pagination Dots $carousel.find('.owl-dot').each(function(index) { $(this).attr('aria-label', 'Go to slide ' + (index + 1)); }); } //catering-slider if ($('.catering-slider').length > 0) { $('.catering-slider').owlCarousel({ loop: true, margin: 24, nav: false, dots: true, smartSpeed: 2000, autoplay: false, onInitialized: setNavLabels, // Aria label onRefreshed: setNavLabels, // Aria label navText: [ '', '' ], responsive: { 0: { items: 1 }, 550: { items: 2 }, 768: { items: 3 }, 1000: { items: 4 } } }) } // Testimonial slider if ($('.testimonial-slider').length > 0) { $('.testimonial-slider').owlCarousel({ loop: true, margin: 24, nav: true, dots: false, smartSpeed: 2000, onInitialized: setNavLabels, // Aria label onRefreshed: setNavLabels, // Aria label navText: ["", ""], responsive: { 0: { items: 1 }, 992: { items: 2 }, 1000: { items: 3 } } }) } // Testimonial slider if ($('.testimonial-slider-3').length > 0) { $('.testimonial-slider-3').owlCarousel({ loop: true, margin: 24, nav: true, dots: false, smartSpeed: 2000, onInitialized: setNavLabels, // Aria label onRefreshed: setNavLabels, // Aria label navText: ["", ""], responsive: { 0: { items: 1 }, 992: { items: 2 }, 1000: { items: 2 } } }) } // Testimonial slider-02 if ($('.testimonial-slider2').length > 0) { $('.testimonial-slider2').owlCarousel({ loop: true, margin: 24, nav: false, dots: false, smartSpeed: 2000, navText: ["", ""], responsive: { 0: { items: 1 }, 700: { items: 4 }, 1000: { items: 5 } } }) } // Blog Slider if ($('.blog-slider').length > 0) { $('.blog-slider').owlCarousel({ loop: true, margin: 24, nav: true, dots: false, smartSpeed: 2000, autoplay: false, onInitialized: setNavLabels, // Aria label onRefreshed: setNavLabels, // Aria label navText: [ '', '' ], responsive: { 0: { items: 1 }, 550: { items: 1 }, 768: { items: 2 }, 992: { items: 3 }, 1200: { items: 4 } } }) } // Gallery Slider if ($('.gallery-slider').length > 0) { $('.gallery-slider').owlCarousel({ loop: true, margin: 16, nav: true, dots: false, smartSpeed: 2000, autoplay: false, onInitialized: setNavLabels, // Aria label onRefreshed: setNavLabels, // Aria label navText: [ '', '' ], responsive: { 0: { items: 2 }, 550: { items: 4 }, 992: { items: 4 }, 1200: { items: 5 }, 1400: { items: 6 } } }) } // Service Slider if ($('.service-carousel').length > 0) { $(document).ready(function () { var sync1 = $("#large-img"); var sync2 = $("#small-img"); var slidesPerPage = 5; // Number of thumbnails per page var syncedSecondary = true; sync1.owlCarousel({ items: 1, slideSpeed: 2000, nav: true, autoplay: false, dots: false, loop: true, navText: [ '', '' ], responsiveRefreshRate: 200, }).on('changed.owl.carousel', syncPosition); sync2.owlCarousel({ items: slidesPerPage, dots: false, nav: true, margin: 10, smartSpeed: 1000, slideSpeed: 500, slideBy: slidesPerPage, responsiveRefreshRate: 100, navText: [ '', '' ], }).on('initialized.owl.carousel', function () { sync2.find(".owl-item").eq(0).addClass("current"); }).on('changed.owl.carousel', syncPosition2); function syncPosition(el) { var count = el.item.count - 1; var current = Math.round(el.item.index - (el.item.count / 2) - .5); if (current < 0) { current = count; } if (current > count) { current = 0; } sync2 .find(".owl-item") .removeClass("current") .eq(current) .addClass("current"); var onscreen = sync2.find('.owl-item.active').length - 1; var start = sync2.find('.owl-item.active').first().index(); var end = sync2.find('.owl-item.active').last().index(); if (current > end) { sync2.data('owl.carousel').to(current, 100, true); } if (current < start) { sync2.data('owl.carousel').to(current - onscreen, 100, true); } } function syncPosition2(el) { if (syncedSecondary) { var number = el.item.index; sync1.data('owl.carousel').to(number, 100, true); } } sync2.on("click", ".owl-item", function (e) { e.preventDefault(); var number = $(this).index(); sync1.data('owl.carousel').to(number, 300, true); }); }); } // Vertical Slider if ($('.vertical-slider').length > 0) { $('.slider-for').slick({ slidesToShow: 1, slidesToScroll: 1, arrows: false, fade: true, asNavFor: '.slider-nav' }); $('.slider-nav').slick({ slidesToShow: 4, slidesToScroll: 1, vertical: true, asNavFor: '.slider-for', dots: false, arrows: true, focusOnSelect: true, verticalSwiping: true, prevArrow: "", nextArrow: "", responsive: [ { breakpoint: 992, settings: { slidesToShow: 3, } }, { breakpoint: 768, }, { breakpoint: 580, settings: { slidesToShow: 2, } }, { breakpoint: 0, settings: { vertical: false, slidesToShow: 1, } } ] }); } // Radio active if ($('.form-radio').length > 0) { $('.form-radio').on('click', function (e) { e.preventDefault(); var radioButton = $(this).find('input[type="radio"]'); var groupName = radioButton.attr('name'); $('.form-radio').each(function () { var currentRadioButton = $(this).find('input[type="radio"]'); if (currentRadioButton.attr('name') === groupName) { $(this).removeClass('active'); currentRadioButton.prop('checked', false); } }); $(this).addClass('active'); radioButton.prop('checked', true); }); } if ($('.group-radio').length > 0) { $('.group-radio .form-check').on('click', function (e) { e.preventDefault(); var radioButton = $(this).find('input[type="radio"]'); var groupName = radioButton.attr('name'); $('.group-radio').each(function () { var currentRadioButton = $(this).find('input[type="radio"]'); if (currentRadioButton.attr('name') === groupName) { currentRadioButton.prop('checked', false); } }); radioButton.prop('checked', true); }); } // Checkbox Active if ($('.form-checkbox').length > 0) { $('.form-checkbox').on('click', function (e) { e.stopPropagation(); $(this).toggleClass('active'); var checkbox = $(this).find('input[type="checkbox"]'); checkbox.prop('checked', !checkbox.prop('checked')); }); // Click event specifically for the checkbox input $('.form-checkbox input[type="checkbox"]').on('click', function (e) { $(this).closest('.form-checkbox').toggleClass('active'); var checkbox = $(this).find('input[type="checkbox"]'); checkbox.prop('checked', !checkbox.prop('checked')); }); } // Checkbox Active if ($('.payment-item').length > 0) { $('.payment-item').on('click', function (e) { e.preventDefault(); var radioButton = $(this).find('input[type="radio"]'); var groupName = radioButton.attr('name'); $('.payment-item').each(function () { var currentRadioButton = $(this).find('input[type="radio"]'); if (currentRadioButton.attr('name') === groupName) { $(this).removeClass('active'); currentRadioButton.prop('checked', false); } }); $(this).addClass('active'); radioButton.prop('checked', true); // Toggle 'active' class on #btn based on the checked state of the radio button if (radioButton.prop('checked')) { $('#pay-btn').addClass('active'); } else { $('#pay-btn').removeClass('active'); } }); } // Scroll Top $(window).scroll(function () { var scroll = $(window).scrollTop(); if (scroll >= 500) { $(".back-to-top-icon").addClass("show"); } else { $(".back-to-top-icon").removeClass("show"); } }); // More btn $('.more-btn').on('click', function () { var text = $('.more-text'); var btn = $(this); if (text.hasClass('expanded')) { text.removeClass('expanded'); btn.text('Read More'); } else { text.addClass('expanded'); btn.text('Read Less'); } }); // Service slider if ($('.owl-carousel.customer-review-slider').length > 0) { $('.owl-carousel.customer-review-slider').owlCarousel({ loop: true, margin: 24, nav: false, dots: true, smartSpeed: 2000, navText: ["", ""], responsive: { 0: { items: 1 }, 550: { items: 1 }, 700: { items: 1 }, 1000: { items: 1 } } }) } // Service slider if ($('.owl-carousel.service-nine-slider').length > 0) { $('.owl-carousel.service-nine-slider').owlCarousel({ loop: true, margin: 24, nav: false, dots: true, smartSpeed: 2000, navText: ["", ""], dotsContainer: '.slidernav', responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 2 }, 1200: { items: 4 }, 1400: { items: 4 } } }) } // Service slider if ($('.owl-carousel.additional-slider').length > 0) { $('.owl-carousel.additional-slider').owlCarousel({ loop: true, margin: 24, nav: false, dots: true, smartSpeed: 2000, navText: ["", ""], dotsContainer: '.slidernav1', responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 2 }, 1200: { items: 4 }, 1400: { items: 4 } } }) } // Blogs slider if ($('.owl-carousel.blogs-nine-slider').length > 0) { $('.owl-carousel.blogs-nine-slider').owlCarousel({ loop: true, margin: 24, nav: false, dots: true, smartSpeed: 2000, navText: ["", ""], dotsContainer: '.slidernav2', responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 2 }, 1200: { items: 3 }, 1400: { items: 3 } } }) } // Provider slider if ($('.owl-carousel.provider-nine-slider').length > 0) { $('.owl-carousel.provider-nine-slider').owlCarousel({ loop: true, margin: 24, nav: false, dots: true, smartSpeed: 2000, navText: ["", ""], dotsContainer: '.slidernav3', responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 3 }, 1200: { items: 4 }, 1400: { items: 4 } } }) } // Provider slider if ($('.owl-carousel.provider-nine-slider2').length > 0) { $('.owl-carousel.provider-nine-slider2').owlCarousel({ loop: true, margin: 24, nav: false, dots: true, smartSpeed: 2000, navText: ["", ""], dotsContainer: '.slidernav4', responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 3 }, 1200: { items: 4 }, 1400: { items: 4 } } }) } // Quote-slider if ($('.owl-carousel.quote-slider').length > 0) { $('.owl-carousel.quote-slider').owlCarousel({ loop: true, margin: 24, nav: false, dots: false, smartSpeed: 2000, autoplay: true, responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 3 }, 1200: { items: 5 }, 1400: { items: 5 } } }) } }); // Provider Wizard $(document).ready(function () { /*---------------------------------------------------------*/ $(".wizard-fieldset #first-field .next_btn").on('click', function () { $('#providerwizard .active').removeClass('active').addClass('active').next().addClass(''); }); $(".wizard-fieldset .next_btn").on('click', function () { // Function Runs On NEXT Button Click $(this).closest('fieldset').next().fadeIn('slow'); $(this).closest('fieldset').css({ 'display': 'none' }); $.fn.hasId = function (id) { return this.closest('#' + id).length > 0; }; // Adding Class Active To Show Steps Forward; if ($(this).hasId('first-field')) { $('#providerwizard .active').addClass('active'); } else { $('#providerwizard .active').removeClass('active').addClass('activated').next().addClass('active'); } }); $(".wizard-fieldset .prev_btn").on('click', function () { // Function Runs On NEXT Button Click $(this).closest('fieldset').prev().fadeIn('slow'); $(this).closest('fieldset').css({ 'display': 'none' }); // Adding Class Active To Show Steps Forward; if ($(this).closest('.second-field').length) { $(this).closest('.wizard-fieldset').find('#providerwizard li:first-child').addClass('active'); } else { $('#providerwizard .active').removeClass('active').prev().removeClass('activated').addClass('active'); } }); }); // Provider Wizard $(document).ready(function () { if ($('.progress-fieldset').length > 0) { let currentStep = 0; const totalSteps = $(".progress-fieldset fieldset").length; // Assuming each fieldset represents a step const progressBar = $(".progress-bar"); // Your progress bar element // Function to update the progress bar based on the current step function updateProgress() { const percent = (currentStep / (totalSteps - 1)) * 100; progressBar.css('width', percent + "%"); } // NEXT Button Click $(".progress-fieldset .next_btn").on('click', function () { if (currentStep < totalSteps - 1) { currentStep++; $(this).closest('fieldset').next().fadeIn('slow'); $(this).closest('fieldset').css('display', 'none'); updateProgress(); } }); // PREVIOUS Button Click $(".progress-fieldset .prev_btn").on('click', function () { if (currentStep > 0) { currentStep--; $(this).closest('fieldset').prev().fadeIn('slow'); $(this).closest('fieldset').css('display', 'none'); updateProgress(); } }); // Initialize progress on page load updateProgress(); } if ($('.fieldset-wizard').length > 0) { $(".fieldset-wizard .next_btn").on('click', function () { // Function Runs On NEXT Button Click $(this).closest('fieldset').next().fadeIn('slow').css({ 'display': 'flex' }); $(this).closest('fieldset').css({ 'display': 'none' }); // Adding Class Active To Show Steps Forward; $('.wizard-progress .active').removeClass('active').addClass('activated').next().addClass('active'); }); $(".fieldset-wizard .prev_btn").on('click', function () { // Function Runs On NEXT Button Click $(this).closest('fieldset').prev().fadeIn('slow').css({ 'display': 'flex' }); $(this).closest('fieldset').css({ 'display': 'none' }); // Adding Class Active To Show Steps Forward; $('.wizard-progress .active').removeClass('active').prev().removeClass('activated').addClass('active'); }); } }); // Datetimepicker if ($('.datepic').length > 0) { $('.datepic').datetimepicker({ format: 'DD-MM-YYYY', keepOpen: true, inline: true, inline: true, icons: { up: "fas fa-angle-up", down: "fas fa-angle-down", next: 'fas fa-angle-right', previous: 'fas fa-angle-left' } }); } // Select 2 if ($('.select').length > 0) { $('.select').select2({ minimumResultsForSearch: -1, width: '100%' }); } // Create Service Wizard $(document).ready(function () { /*---------------------------------------------------------*/ $(".service-inform-fieldset .next_btn").on('click', function () { // Function Runs On NEXT Button Click $(this).closest('fieldset').next().fadeIn('slow'); $(this).closest('fieldset').css({ 'display': 'none' }); // Adding Class Active To Show Steps Forward; $('#progressbar .active').removeClass('active').addClass('activated').next().addClass('active'); }); $(".service-inform-fieldset .prev_btn").on('click', function () { // Function Runs On NEXT Button Click $(this).closest('fieldset').prev().fadeIn('slow'); $(this).closest('fieldset').css({ 'display': 'none' }); // Adding Class Active To Show Steps Forward; $('#progressbar .active').removeClass('active').prev().removeClass('activated').addClass('active'); }); }); // Edit Availability $(document).ready(function () { /*---------------------------------------------------------*/ $("#edit-availability .next_btn").on('click', function () { // Function Runs On NEXT Button Click $(this).closest('fieldset').next().fadeIn('slow'); $(this).closest('fieldset').css({ 'display': 'none' }); // Adding Class Active To Show Steps Forward; $('#progress-list .active').removeClass('active').addClass('activated').next().addClass('active'); }); $("#edit-availability .prev_btn").on('click', function () { // Function Runs On NEXT Button Click $(this).closest('fieldset').prev().fadeIn('slow'); $(this).closest('fieldset').css({ 'display': 'none' }); // Adding Class Active To Show Steps Forward; $('#progress-list .active').removeClass('active').prev().removeClass('activated').addClass('active'); }); }); // Multiple Image if ($('.multiple-img').length > 0) { function formatState(state) { if (!state.id) { return state.text; } var $state = $( ' ' + state.text + '' ); return $state; }; $('.multiple-img').select2({ minimumResultsForSearch: Infinity, templateResult: formatState, templateSelection: formatState }); } // Select Image if ($('.select-img').length > 0) { function formatState(state) { if (!state.id) { return state.text; } var $state = $( ' ' + state.text + '' ); return $state; }; $('.select-img').select2({ minimumResultsForSearch: Infinity, templateResult: formatState, templateSelection: formatState }); } // Add Service Information $(".add-extra").on('click', function () { var servicecontent = '
' + '
' + '
' + '' + '
' + '' + '' + '
' + '
' + '
' + '
'; $(".addtitle-info").append(servicecontent); return false; }); $(".addtitle-info").on('click', '.delete-item', function () { $(this).closest('.extra-title-row').remove(); return false; }); $(".add-extra2").on('click', function () { var servicecontent = '
' + '
' + '
' + '
' + '' + '' + '
' + '
' + '' + '' + '
' + '
' + '
' + '
' + '
' + '' + '' + '
' + '
' + '
' + '
' + '' + '
' + '' + '' + '
' + '
' + '
' + '
'; $(".addservice-info").append(servicecontent); return false; }); $(".addservice-info").on('click', '.delete-item', function () { $(this).closest('.addservice-info-row').remove(); return false; }); $(".add-extra-faq").on('click', function () { var servicecontent = '
' + '
' + '
' + '' + '' + '
' + '
' + '
' + '
' + '' + '
' + '' + '' + '
' + '
' + '
' + '
'; $(".add-faq-info").append(servicecontent); return false; }); $(".add-faq-info").on('click', '.delete-item', function () { $(this).closest('.add-faq-row').remove(); return false; }); // Remove Gallery $(document).on("click", ".trash-top", function () { $(this).parent().hide(); }); // Ck Editor if ($('.ck-editor').length > 0) { ClassicEditor .create(document.querySelector('.ck-editor'), { toolbar: { items: [ 'heading', '|', 'fontfamily', 'fontsize', '|', 'alignment', '|', 'fontColor', 'fontBackgroundColor', '|', 'bold', 'italic', 'strikethrough', 'underline', 'subscript', 'superscript', '|', 'link', '|', 'outdent', 'indent', '|', 'bulletedList', 'numberedList', 'todoList', '|', 'code', 'codeBlock', '|', 'insertTable', '|', 'uploadImage', 'blockQuote', '|', 'undo', 'redo' ], shouldNotGroupWhenFull: true } }) .then(editor => { window.editor = editor; }) .catch(err => { console.error(err.stack); }); } if ($('#more').length > 0) { const button = document.getElementById('more'); const container = document.getElementById('fill-more'); let isLess = true; function viewMoreLess() { if (isLess) { isLess = false; container.style.height = 'auto'; button.innerHTML = "View less "; } else { isLess = true; container.style.height = '150px'; button.innerHTML = "View more "; } } button.addEventListener('click', viewMoreLess); } jQuery(document).ready(function ($) { if (window != window.top) { window.top.location.href = window.location.href; } }); // Custom Country Code Selector if ($('#phone').length > 0) { var input = document.querySelector("#phone"); window.intlTelInput(input, { utilsScript: "assets/plugins/intltelinput/js/utils.js", }); } if ($('#phone1').length > 0) { var input = document.querySelector("#phone1"); window.intlTelInput(input, { utilsScript: "assets/plugins/intltelinput/js/utils.js", }); } // Zoom Meet $('#google_meet').click(function () { if ($(this).is(':checked')) { $(".google-meet-link").show(); $(".zoom-meet-link").hide(); } else { $(".google-meet-link").hide(); $(".zoom-meet-link").show(); } }); $('#zoom_meet').click(function () { if ($(this).is(':checked')) { $(".google-meet-link").hide(); $(".zoom-meet-link").show(); } else { $(".google-meet-link").show(); $(".zoom-meet-link").hide(); } }); // JQuery counterUp if ($('.counter').length > 0) { $('.counter').counterUp({ delay: 10, time: 2000 }); $('.counter').addClass('animated fadeInDownBig'); } // Sticky Sidebar if ($(window).width() > 767) { if ($('.theiaStickySidebar').length > 0) { $('.theiaStickySidebar').theiaStickySidebar({ // Settings additionalMarginTop: 125 }); } } // Maximize if ($('.win-maximize').length > 0) { $('.win-maximize').on('click', function (e) { if (!document.fullscreenElement) { document.documentElement.requestFullscreen(); } else { if (document.exitFullscreen) { document.exitFullscreen(); } } }) } // Area Expert if ($('.area-expert-slider').length > 0) { $('.area-expert-slider').owlCarousel({ loop: false, margin: 24, nav: false, dots: false, smartSpeed: 2000, autoplay: true, responsive: { 0: { items: 1 }, 550: { items: 2 }, 768: { items: 4 }, 1200: { items: 5 }, 1400: { items: 6 } } }) } // services-slider if ($('.owl-carousel.services-slider').length > 0) { $('.owl-carousel.services-slider').owlCarousel({ loop: true, margin: 24, nav: true, dots: false, smartSpeed: 2000, navText: ["", ""], responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 2 }, 1200: { items: 4 }, 1400: { items: 4 } } }) } // Our Services if ($('.our-services-slider').length > 0) { $('.our-services-slider').owlCarousel({ loop: false, margin: 24, nav: true, dots: false, smartSpeed: 2000, autoplay: false, navText: [ '', '' ], responsive: { 0: { items: 1 }, 550: { items: 1 }, 768: { items: 2 }, 1200: { items: 2 }, 1400: { items: 3 } } }) } // Our Branches if ($('.our-branches-slider').length > 0) { $('.our-branches-slider').owlCarousel({ loop: false, margin: 15, nav: true, dots: false, smartSpeed: 2000, autoplay: true, navText: [ '', '' ], responsive: { 0: { items: 1 }, 550: { items: 2 }, 768: { items: 3 }, 1200: { items: 3 }, 1400: { items: 4 } } }) } // Provider Gallery Slider if ($('.provider-gallery-slider').length > 0) { $('.provider-gallery-slider').owlCarousel({ loop: false, margin: 15, nav: true, dots: false, smartSpeed: 2000, autoplay: true, navText: [ '', '' ], responsive: { 0: { items: 1 }, 550: { items: 2 }, 768: { items: 3 }, 1200: { items: 3 }, 1400: { items: 4 } } }) } // Service slider if ($('.owl-carousel.categories-slider-seven').length > 0) { $('.owl-carousel.categories-slider-seven').owlCarousel({ loop: true, margin: 24, nav: true, dots: true, smartSpeed: 2000, navText: ["", ""], navContainer: '.mynav', responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 3 }, 1200: { items: 4 }, 1400: { items: 5 } } }) } // Service slider if ($('.owl-carousel.popular-service-seven').length > 0) { $('.owl-carousel.popular-service-seven').owlCarousel({ loop: true, margin: 24, nav: false, dots: true, smartSpeed: 2000, navText: ["", ""], responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 2 }, 1000: { items: 3 } } }) } // Service slider if ($('.owl-carousel.testimonals-eight-slider').length > 0) { $('.owl-carousel.testimonals-eight-slider').owlCarousel({ loop: true, margin: 24, nav: true, dots: false, smartSpeed: 2000, navText: ["", ""], responsive: { 0: { items: 1 }, 550: { items: 1 }, 700: { items: 1 }, 1000: { items: 1 } } }) } // Service slider if ($('.owl-carousel.blog-eight-slider').length > 0) { $('.owl-carousel.blog-eight-slider').owlCarousel({ loop: true, margin: 24, nav: true, dots: false, smartSpeed: 2000, navText: ["", ""], responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 2 }, 1200: { items: 3 }, 1400: { items: 3 } } }) } // Service slider if ($('.owl-carousel.recent-projects-seven').length > 0) { $('.owl-carousel.recent-projects-seven').owlCarousel({ loop: true, margin: 24, nav: false, dots: true, smartSpeed: 2000, navText: ["", ""], navContainer: '.mynav-seven-two', responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 2 }, 1000: { items: 3 } } }) } // Service slider if ($('.owl-carousel.top-projects-seven').length > 0) { $('.owl-carousel.top-projects-seven').owlCarousel({ loop: true, margin: 24, nav: true, dots: true, smartSpeed: 2000, navText: ["", ""], navContainer: '.mynav-seven-three', responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 2 }, 1200: { items: 3 }, 1400: { items: 4 } } }) } // Service slider if ($('.owl-carousel.category-eight-slider').length > 0) { $('.owl-carousel.category-eight-slider').owlCarousel({ loop: true, margin: 24, nav: true, dots: false, smartSpeed: 2000, navText: ["", ""], responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 3 }, 1200: { items: 6 }, 1400: { items: 6 } } }) } // Service slider if ($('.owl-carousel.professional-eight-slider').length > 0) { $('.owl-carousel.professional-eight-slider').owlCarousel({ loop: true, margin: 24, nav: true, dots: false, smartSpeed: 2000, navText: ["", ""], responsive: { 0: { items: 1 }, 550: { items: 1 }, 700: { items: 2 }, 1200: { items: 3 }, 1400: { items: 4 } } }) } // Service slider if ($('.owl-carousel.testimonals-seven-slider').length > 0) { $('.owl-carousel.testimonals-seven-slider').owlCarousel({ loop: true, margin: 24, nav: true, dots: false, smartSpeed: 2000, navText: ["", ""], navContainer: '.mynav-test', responsive: { 0: { items: 1 }, 550: { items: 1 }, 700: { items: 1 }, 1000: { items: 1 } } }) } // Service slider if ($('.owl-carousel.our-recent-blog').length > 0) { $('.owl-carousel.our-recent-blog').owlCarousel({ loop: true, margin: 24, nav: false, dots: true, smartSpeed: 2000, navText: ["", ""], responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 2 }, 1000: { items: 3 } } }) } // Service slider if ($('.owl-carousel.partners-slider-seven').length > 0) { $('.owl-carousel.partners-slider-seven').owlCarousel({ loop: true, margin: 24, nav: false, dots: false, smartSpeed: 2000, autoplay: true, responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 3 }, 1200: { items: 5 }, 1400: { items: 5 } } }) } // Calendar if ($('#calendar').length > 0) { document.addEventListener('DOMContentLoaded', function () { var calendarEl = document.getElementById('calendar'); var calendar = new FullCalendar.Calendar(calendarEl, { themeSystem: 'bootstrap5', headerToolbar: { left: 'title, prev,today next', //center: '', right: 'dayGridMonth,timeGridWeek,timeGridDay,listMonth' }, initialDate: '2024-08-12', navLinks: true, // can click day/week names to navigate views // businessHours: true, // display business hours editable: true, selectable: true, events: [ { title: 'Leave', start: '2023-11-16', end: '2023-11-16', color: '#E8E8E8', textColor: '#585757' }, { title: 'Leave', start: '2023-11-03', end: '2023-11-03', color: '#E8E8E8', textColor: '#585757' }, { title: 'Weekly Holiday', start: '2023-11-06', end: '2023-11-06', color: '#ff3b3b1a', textColor: '#E92C2C' }, { title: 'Weekly Holiday', start: '2023-11-13', end: '2023-11-13', color: '#ff3b3b1a', textColor: '#E92C2C' }, { title: 'Weekly Holiday', start: '2023-11-20', end: '2023-11-20', color: '#ff3b3b1a', textColor: '#E92C2C' }, { title: 'Weekly Holiday', start: '2023-11-27', end: '2023-11-27', color: '#ff3b3b1a', textColor: '#E92C2C' }, ] }); calendar.render(); }); } // Calendar Booking if ($('#calendar-book').length > 0) { document.addEventListener('DOMContentLoaded', function () { var calendarEl = document.getElementById('calendar-book'); var calendar = new FullCalendar.Calendar(calendarEl, { themeSystem: 'bootstrap5', headerToolbar: { left: 'title, prev,today next', //center: '', right: 'dayGridMonth,timeGridWeek,timeGridDay,listMonth', }, initialDate: '2023-11-12', navLinks: true, // can click day/week names to navigate views // businessHours: true, // display business hours editable: true, selectable: true, events: [ { title: '12:30am Laptop serv...', start: '2023-11-02', end: '2023-11-02', color: '#EAEBEE', textColor: '#242B3A', "className": "fc-event-title", }, { title: '10:00am House Clean..', start: '2023-11-04', end: '2023-11-04', color: '#EAEBEE', textColor: '#242B3A', }, { title: '11:00am Washing ...', start: '2023-11-05', end: '2023-11-05', color: '#EAEBEE', textColor: '#242B3A', }, { title: '02:00pm Toughened...', start: '2023-11-10', end: '2023-11-10', color: '#EAEBEE', textColor: '#242B3A', }, { title: '05:00pm Interior ...', start: '2023-11-16', end: '2023-11-16', color: '#EAEBEE', textColor: '#242B3A', }, { title: '01:00pm Building....', start: '2023-11-18', end: '2023-11-18', color: '#EAEBEE', textColor: '#242B3A', }, ], eventClick: function (event, calEvent, jsEvent, view) { // Using event delegation for dynamically added content $(document).ready(function () { // Bind event handlers globally to handle clicks $(document).on('click', '.fc-event-title', function () { $('.toggle-sidebar').addClass('sidebar-popup'); $('.sidebar-overlay').addClass('opened'); }); $(document).on('click', '.sidebar-close', function () { $('.toggle-sidebar').removeClass('sidebar-popup'); $('.sidebar-overlay').removeClass('opened'); }); $(document).on('click', '.sidebar-overlay', function () { $('.toggle-sidebar').removeClass('sidebar-popup'); }); }); } }); calendar.render(); }); } // toggle-password if ($('.toggle-password').length > 0) { $(document).on('click', '.toggle-password', function () { // Toggle the eye icon classes $(this).toggleClass("feather-eye feather-eye-off"); // Get the input field within the same .pass-group var input = $(this).siblings(".pass-input"); // Toggle the type attribute if (input.attr("type") == "password") { input.attr("type", "text"); } else { input.attr("type", "password"); } }); } // Otp Verfication   $('.digit-group').find('input').each(function () { $(this).attr('maxlength', 1); $(this).on('keyup', function (e) { var parent = $($(this).parent()); if (e.keyCode === 8 || e.keyCode === 37) { var prev = parent.find('input#' + $(this).data('previous')); if (prev.length) { $(prev).select(); } } else if ((e.keyCode >= 48 && e.keyCode <= 57) || (e.keyCode >= 65 && e.keyCode <= 90) || (e.keyCode >= 96 && e.keyCode <= 105) || e.keyCode === 39) { var next = parent.find('input#' + $(this).data('next')); if (next.length) { $(next).select(); } else { if (parent.data('autosubmit')) { parent.submit(); } } } }); }); $('.digit-group input').on('keyup', function () { var self = $(this); if (self.val() != '') { self.addClass('active'); } else { self.removeClass('active'); } }); // Datetimepicker Date if ($('.datetimepicker').length > 0) { $('.datetimepicker').datetimepicker({ format: 'DD-MM-YYYY', icons: { up: "fas fa-angle-up", down: "fas fa-angle-down", next: 'fas fa-angle-right', previous: 'fas fa-angle-left' } }); } // Month Year picker if ($('.monthpicker').length > 0) { $('.monthpicker').datetimepicker({ format: 'MM-YYYY', icons: { up: "fas fa-angle-up", down: "fas fa-angle-down", next: 'fas fa-angle-right', previous: 'fas fa-angle-left' } }); } if ($('#datetimepickershow').length > 0) { $('#datetimepickershow').datetimepicker({ inline: true, sideBySide: true, format: 'DD-MM-YYYY', icons: { up: "fas fa-angle-up", down: "fas fa-angle-down", next: 'fas fa-angle-right', previous: 'fas fa-angle-left' } }); } // Datetimepicker time if ($('.timepicker').length > 0) { $('.timepicker').datetimepicker({ format: 'HH:mm A', icons: { up: "fas fa-angle-up", down: "fas fa-angle-down", next: 'fas fa-angle-right', previous: 'fas fa-angle-left' } }); } // Rating Star Review const stars = document.querySelectorAll('.rating-select i'); const starsNone = document.querySelector('.form-info'); // ---- ---- Stars ---- ---- // stars.forEach((star, index1) => { star.addEventListener('click', () => { stars.forEach((star, index2) => { // ---- ---- Active Star ---- ---- // index1 >= index2 ? star.classList.add('active') : star.classList.remove('active'); }); }); }); //Payments $('.card-payments').on('click', function () { $('.card-payments').removeClass('active'); $(this).addClass('active'); }); // Coming Soon if ($('.comming-soon-pg').length > 0) { // Get html elements let day = document.querySelector('.days'); let hour = document.querySelector('.hours'); let minute = document.querySelector('.minutes'); let second = document.querySelector('.seconds'); function setCountdown() { // Set countdown date let countdownDate = new Date('Sep 30, 2024 16:00:00').getTime(); // Update countdown every second let updateCount = setInterval(function () { // Get today's date and time let todayDate = new Date().getTime(); // Get distance between now and countdown date let distance = countdownDate - todayDate; let days = Math.floor(distance / (1000 * 60 * 60 * 24)); let hours = Math.floor(distance % (1000 * 60 * 60 * 24) / (1000 * 60 * 60)); let minutes = Math.floor(distance % (1000 * 60 * 60) / (1000 * 60)); let seconds = Math.floor(distance % (1000 * 60) / 1000); // Display values in html elements day.textContent = days; hour.textContent = hours; minute.textContent = minutes; second.textContent = seconds; // if countdown expires if (distance < 0) { clearInterval(updateCount); document.querySelector(".comming-soon-pg").innerHTML = '

EXPIRED

' } }, 1000) } setCountdown() } //Search Bar $(document).ready(function () { $(".searchbar a").click(function () { $(".togglesearch").slideToggle(); $(".top-search").focus(); }); }); // fade in scroll $(document).ready(function () { if ($('.main-wrapper .aos').length > 0) { AOS.init({ duration: 1200, once: true }); } }); // Service slider if ($('.owl-carousel.customer-review-slider').length > 0) { $('.owl-carousel.customer-review-slider').owlCarousel({ loop: true, margin: 24, nav: false, dots: true, smartSpeed: 2000, navText: ["", ""], responsive: { 0: { items: 1 }, 550: { items: 1 }, 700: { items: 1 }, 1000: { items: 1 } } }) } $('.user-sidebar a').on('click', function (e) { if ($(this).parent().hasClass('submenu')) { e.preventDefault(); } if (!$(this).hasClass('subdrop')) { $('ul', $(this).parents('ul:first')).hide(350); $('a', $(this).parents('ul:first')).removeClass('subdrop'); $(this).next('ul').show(350); $(this).addClass('subdrop'); } else if ($(this).hasClass('subdrop')) { $(this).removeClass('subdrop'); $(this).next('ul').hide(350); } }); $('.user-sidebar ul li.submenu a.active').parents('li:last').children('a:first').addClass('active').trigger('click'); if ($('.typed').length > 0) { document.addEventListener('DOMContentLoaded', function () { ityped.init(document.querySelector(".typed"), { strings: ['Carpenders', 'Stylist', 'Builders'], typeSpeed: 150, // Speed of typing backSpeed: 80, // Speed of backspacing loop: true // Loops the animation }); }); } // Installer Wizard $(document).ready(function () { let progressVal = 0; let businessType = 0; $(".next_btns").on('click', function () { $(this).parent().parent().parent().next().fadeIn('slow'); $(this).parent().parent().parent().css({ 'display': 'none' }); progressVal = progressVal + 1; $('.progress-active').removeClass('progress-active').addClass('progress-activated').next().addClass('progress-active'); }); $(".prev_btns").on('click', function () { $(this).parent().parent().parent().prev().fadeIn('slow'); $(this).parent().parent().parent().css({ 'display': 'none' }); progressVal = progressVal - 1; $('.progress-active').removeClass('progress-active').prev().removeClass('progress-activated').addClass('progress-active'); }); }); //Increment Decrement Numberes var quantity = 0; $('.quantity-plus').click(function (e) { e.preventDefault(); var quantity = parseInt($('#quantity').val()); $('#quantity').val(quantity + 1); }); $('.quantity-minus').click(function (e) { e.preventDefault(); var quantity = parseInt($('#quantity').val()); if (quantity > 0) { $('#quantity').val(quantity - 1); } }); var quantity2 = 0; $('.quantity-plus').click(function (e) { e.preventDefault(); var quantity2 = parseInt($('#increment-count').val()); $('#increment-count').val(quantity2 + 1); }); $('.quantity-minus').click(function (e) { e.preventDefault(); var quantity2 = parseInt($('#increment-count').val()); if (quantity2 > 0) { $('#increment-count').val(quantity2 - 1); } }); var quantity3 = 0; $('.quantity-plus').click(function (e) { e.preventDefault(); var quantity3 = parseInt($('#increment-count2').val()); $('#increment-count2').val(quantity3 + 1); }); $('.quantity-minus').click(function (e) { e.preventDefault(); var quantity3 = parseInt($('#increment-count2').val()); if (quantity3 > 0) { $('#increment-count2').val(quantity3 - 1); } }); // Add to wishlist button document.addEventListener("click", function (e) { if (e.target.closest(".favourite")) { const icon = e.target.closest(".favourite").querySelector("i"); icon.classList.toggle("ti-heart"); icon.classList.toggle("ti-heart-filled"); } }) // if ($('.testimonial-slider-twelve').length > 0) { $('.testimonial-slider-twelve').slick({ slidesToShow: 3, slidesToScroll: 1, dots: false, arrows: false, centerMode: true, focusOnSelect: true, responsive: [ { breakpoint: 1400, settings: { slidesToShow: 3 } }, { breakpoint: 1200, settings: { slidesToShow: 2 } }, { breakpoint: 992, settings: { slidesToShow: 2 } }, { breakpoint: 768, settings: { slidesToShow: 1, slidesToScroll: 1, variableWidth: false, centerMode: false }} ] }); } // Signature (index-5) // All Sliders if ($('.slider-wrapper').length > 0) { function initSliders() { $('.interior-slider, .office-slider, .cabinet-slider, .ceiling-slider').each(function () { const $slider = $(this); if (!$slider.hasClass('slick-initialized')) { $slider.slick({ dots: false, infinite: true, speed: 2000, slidesToShow: 4, slidesToScroll: 1, centerMode: true, autoplay: false, arrows: false, // disable default arrows responsive: [ { breakpoint: 1400, settings: { slidesToShow: 4 } }, { breakpoint: 1200, settings: { slidesToShow: 3 } }, { breakpoint: 992, settings: { slidesToShow: 2 } }, { breakpoint: 768, settings: { slidesToShow: 1 } }, { breakpoint: 576, settings: { slidesToShow: 1, slidesToScroll: 1, variableWidth: false, centerMode: false }} ] }); } }); } initSliders(); // Global arrow buttons control the currently active tab’s slider $('.all-prev').on('click', function () { $('.slider-wrapper .tab-pane.active .slick-slider').slick('slickPrev'); }); $('.all-next').on('click', function () { $('.slider-wrapper .tab-pane.active .slick-slider').slick('slickNext'); }); // Fix Slick when switching tabs $('.slider-wrapper a[data-bs-toggle="tab"]').on('shown.bs.tab', function (e) { const target = $($(this).attr('data-bs-target')); setTimeout(() => { target.find('.slick-slider').slick('setPosition'); }, 100); }); } // Wow if (typeof WOW !== "undefined") { new WOW({ offset: 0, mobile: true }).init(); } // Animate Button const animatedButtons = document.querySelectorAll('.animate-button2'); animatedButtons.forEach(btn => { const textContainer = btn.querySelector('.button-text2'); const text = btn.getAttribute('data-text'); if (textContainer && text) { // Split the text into characters const characters = text.split(''); const angleStep = 360 / characters.length; // Set the angle variable on this specific button btn.style.setProperty('--angle', angleStep); // Map characters to spans with their specific index textContainer.innerHTML = characters.map((char, i) => { return `${char}`; }).join(''); } }); const wrappers = document.querySelectorAll('.wrapper'); wrappers.forEach((wrapper) => { // Scope these to the current wrapper instance const scroller = wrapper.querySelector('.scroller'); const after = wrapper.querySelector('.after'); if (!scroller || !after) { console.warn('Init aborted: .scroller or .after element missing in a wrapper.'); return; } let active = false; const startScrolling = () => { active = true; scroller.classList.add('scrolling'); }; const stopScrolling = () => { active = false; scroller.classList.remove('scrolling'); }; // Helper to calculate position relative to THIS specific wrapper function scrollIt(x) { const rect = wrapper.getBoundingClientRect(); const relativeX = x - rect.left; const transform = Math.max(0, Math.min(relativeX, wrapper.offsetWidth)); after.style.width = transform + "px"; scroller.style.left = (transform - 25) + "px"; } // Event Listeners scroller.addEventListener('mousedown', startScrolling); scroller.addEventListener('touchstart', startScrolling); // Global listeners for mouse/touch movement while active window.addEventListener('mouseup', stopScrolling); window.addEventListener('mouseleave', stopScrolling); window.addEventListener('touchend', stopScrolling); window.addEventListener('touchcancel', stopScrolling); window.addEventListener('mousemove', (e) => { if (!active) return; scrollIt(e.pageX); }); window.addEventListener('touchmove', (e) => { if (!active) return; const t = e.touches && e.touches[0]; if (t) scrollIt(t.pageX); }, { passive: true }); const setInitialPosition = () => { // Get the current width of THIS specific slider const sliderWidth = wrapper.offsetWidth; const halfWay = sliderWidth / 2.07; // We need to pass the absolute page coordinate to scrollIt const rect = wrapper.getBoundingClientRect(); scrollIt(rect.left + halfWay); }; // Run it immediately setInitialPosition(); // Optional: Recalculate if the window is resized so it stays centered window.addEventListener('resize', setInitialPosition); }); // Client Slider if ($('.client-slider').length > 0) { $('.client-slider').slick({ slidesToShow: 6, slidesToScroll: 1, dots: false, arrows: false, focusOnSelect: true, autoplay: true, responsive: [ { breakpoint: 1400, settings: { slidesToShow: 5 } }, { breakpoint: 1200, settings: { slidesToShow: 2 } }, { breakpoint: 992, settings: { slidesToShow: 2 } }, { breakpoint: 768, settings: { slidesToShow: 1 } } ] }); } var containers = document.querySelectorAll(".user-image"); containers.forEach(function(container) { // 2. Find only the slides inside THIS specific container var images = container.getElementsByClassName("slides"); if (images.length > 0) { var index = 0; // 3. Set initial state: hide all, then show the first one for (var i = 0; i < images.length; i++) { images[i].style.display = "none"; } images[0].style.display = "block"; // 4. Start the timer for this specific container setInterval(function() { images[index].style.display = "none"; index = (index + 1) % images.length; images[index].style.display = "block"; }, 2000); } }); // Choices function initChoices() { document.querySelectorAll('[data-choices]').forEach(item => { const config = { allowHTML: true }; const attrs = item.attributes; if (attrs['data-choices-groups']) { config.placeholderValue = 'This is a placeholder set in the config'; } if (attrs['data-choices-search-false']) { config.searchEnabled = false; } if (attrs['data-choices-search-true']) { config.searchEnabled = true; } if (attrs['data-choices-removeItem']) { config.removeItemButton = true; } if (attrs['data-choices-sorting-false']) { config.shouldSort = false; } if (attrs['data-choices-sorting-true']) { config.shouldSort = true; } if (attrs['data-choices-multiple-remove']) { config.removeItemButton = true; } if (attrs['data-choices-limit']) { config.maxItemCount = parseInt(attrs['data-choices-limit'].value); } if (attrs['data-choices-editItem-true']) { config.editItems = true; } if (attrs['data-choices-editItem-false']) { config.editItems = false; } if (attrs['data-choices-text-unique-true']) { config.duplicateItemsAllowed = false; } if (attrs['data-choices-text-disabled-true']) { config.addItems = false; } const instance = new Choices(item, config); if (attrs['data-choices-text-disabled-true']) { instance.disable(); } }); } // Only run the slider code if the element is actually on the page document.addEventListener("DOMContentLoaded", function () { const slider = document.getElementById('range-slider'); // Check BOTH element and library if (slider && typeof noUiSlider !== "undefined") { noUiSlider.create(slider, { start: [200, 800], connect: true, range: { min: 0, max: 1000 }, step: 1, tooltips: [true, true], // ✅ Add this handleAttributes: [ { 'aria-label': 'Minimum price' }, { 'aria-label': 'Maximum price' } ], format: { to: (value) => '$' + Math.round(value), from: (value) => value.replace('$', '') } }); } });